﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MMDemo
{
    class NewGraphsData:InterfaceNewData
    {
        public bool NewData()
        {
            GraphsInputForm grahInput = new GraphsInputForm();
            grahInput.ShowDialog();
            return PublicDataClass.IsInit;
        }
        public void ShowForm(SysDemoForm demof, SysArithmeticForm arif, int Width, int Height)
        {
            demof.Top = 0;
            demof.Left = 0;
            demof.Width = Width - 500;
            demof.Height = Height;
            demof.Show();

            arif.Top = 0;
            arif.Left = Width - 500;
            arif.Width = 500;
            arif.Height = Height;
            arif.Show();
            SetFormText(demof);
        }
        private void SetFormText(SysDemoForm demof)
        {
            String strText = "演示窗口";
            switch (GlobalGraphs.OperatType)
            {
                case GraphsOperateType.BFT:
                    strText = "图的广度优先遍历"; break;
                case GraphsOperateType.DFT:
                    strText = "图的深度优先非递归遍历"; break;
                case GraphsOperateType.Prim:
                    strText = "Prim 最小生成树算法"; break;
                case GraphsOperateType.Kruskal:
                    strText = "Kruskal最小生成树算法"; break;
                case GraphsOperateType.TopologicalSortCheckLoop:
                    strText = "拓朴排序判断无环图"; break;
                case GraphsOperateType.DFTCheckLoop:
                    strText = "深度优先遍历判断无环图"; break;
                case GraphsOperateType.Dijkstra:
                    strText = "Dijkstra求单顶点最短路径 "; break;
                case GraphsOperateType.Bellman_Ford:
                    strText = "Bellman-Ford求单顶点最短路径 "; break;
            }
            demof.Text = strText;
        }
    }
}
